package wfinder;

import static org.jlambda.util.Lists.map;
import static org.jlambda.util.Lists.memoize;
import static org.jlambda.util.Lists.seq;
import static org.jlambda.util.Text.readLines;

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;

import org.jlambda.util.Lists;
import org.jlambda.util.Text;

public class Do100Times {
	public static void main(String[] args) throws Exception {
		
		BufferedReader reader = new BufferedReader(new FileReader("o10k.ap"));
		FileWriter writer = new FileWriter("o1000k.ap");
		
		try{
			Iterable<String> lines = memoize( readLines.apply(reader) );

			for( @SuppressWarnings("unused")
			Number i : Lists.from(1).to(100) ){
				seq( map( Text.<String>println(writer), lines ) );
			}
		} finally {
			reader.close();
			writer.close();
		}
	}

}
